package com.xinyue.auto.reader;

import org.dom4j.Element;

public class EntityReader{
	//私有构造器
	private EntityReader() {
	}
	//内部类
	private static class SingletonHolder{
        private static EntityReader instance = new EntityReader();  
    }
	/**
	 * 获得对象实例
	 */
	public static EntityReader getInstance() {
		return SingletonHolder.instance;
	}
	
	/**
	 * 读取一个XML文件中的Entity标签信息，并返回封装对象
	 * @param entity
	 * @return
	 * @throws Exception
	 */
	public void read(Element entity) throws Exception {
		Process process = EntityFactory.getInstance().initProccess(entity);
		process.work();
	}
}
